<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortalThemeRecord.php 294 2008-11-15 18:44:21Z steen.rabol@gmail.com $
 */

Prado::using('Application.Common.Data.PortalActiveRecord');
Prado::using('Application.Common.Data.PortalThemeCssClassRecord');

class PortalThemeRecord extends PortalActiveRecord
{
	const TABLE='tbltheme';

	public $id;
	public $name;
	public $systemname;
	public $active;

	public static function finder($className=__CLASS__)
	{
		return parent::finder($className);
	}

	public function onDelete (TActiveRecordChangeEventParameter $param)
	{
		$cssRecords	= PortalThemeCssClassRecord::finder()->findAllBythemeid($this->id);
		if($cssRecords !== null)
		{
			foreach($cssRecords as $cssRecord)
			{
				$cssRecord->delete();
			}
		}
	}
}
?>